<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
<h:head>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
</h:head>

<!-- <ui:param name="bean" value="#{biMonitorConfigAction}" /> -->
<h:body>
    <span class="pagetitle">告警管理—— 告警用户配置</span>
    <p:separator />
	<h:form id="fsearch">
		<p:growl id="growl" showDetail="true" sticky="false" life="1000" />
		<p:panel id="panel0" header="查询添加" style="margin-bottom:10px;">
			<p:dataTable id="dlist0" var="l" resizableColumns="true"
				value="#{biMonitorUserConfigAction.entityMonitorUserConfig}">

				<p:column headerText="用户名" styleClass="column">
					<h:inputText value="#{l.userName}" styleClass="fullwidth" />
				</p:column>
				<p:column headerText="微信" styleClass="column">
					<h:inputText value="#{l.weChat}" styleClass="fullwidth" />
				</p:column>
				<p:column headerText="手机号-短信通知" styleClass="column">
					<h:inputText value="#{l.phoneNum}" styleClass="fullwidth" />
				</p:column>
				<p:column headerText="语音号-语音通知" styleClass="column">
					<h:inputText value="#{l.voiceNum}" styleClass="fullwidth" />
				</p:column>
				<p:column headerText="邮箱" styleClass="column">
					<h:inputText value="#{l.email}" styleClass="fullwidth" />
				</p:column>

				<p:column headerText="操作" styleClass="column">
					<p:commandButton value="查询"
						action="#{biMonitorUserConfigAction.searchByCriteria()}"
						update=":datalist:panel1" />
					<p:commandButton value="添加"
						action="#{biMonitorUserConfigAction.addUser()}"
						update=":datalist:panel1 :fsearch:growl :fsearch:panel0" />
				</p:column>
			</p:dataTable>
		</p:panel>
	</h:form>
	<br />
	<h:form id="datalist">
        <p:growl id="growl2" showDetail="true" sticky="false" life="1000" />
		<p:panel id="panel1" header="用户列表" style="margin-bottom:10px;">
			<p:dataTable id="dlist" var="l"
				value="#{biMonitorUserConfigAction.userList}"
				resizableColumns="true" paginator="true" paginatorPosition="top"
				scrollable="true"
				paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="15,30" rows="15" style="text-align:center;">

				<p:column headerText="用户名" styleClass="column">
					<h:inputText value="#{l.userName}" styleClass="fullwidth" />
				</p:column>
				<p:column headerText="微信" styleClass="column">
					<h:inputText value="#{l.weChat}" styleClass="fullwidth" />
				</p:column>
				<p:column headerText="手机号-短信通知" styleClass="column">
					<h:inputText value="#{l.phoneNum}" styleClass="fullwidth" />
				</p:column>
				<p:column headerText="语音号-语音通知" styleClass="column">
					<h:inputText value="#{l.voiceNum}" styleClass="fullwidth" />
				</p:column>
				<p:column headerText="邮箱" styleClass="column">
					<h:inputText value="#{l.email}" styleClass="fullwidth" />
				</p:column>

				<p:column headerText="操作" styleClass="column">
					<p:commandButton value="修改"
						action="#{biMonitorUserConfigAction.modifiyUser(l)}"
						update=":datalist" />
					<p:commandButton value="删除"
						action="#{biMonitorUserConfigAction.delUser(l.id)}"
						update=":datalist" />
				</p:column>
			</p:dataTable>
		</p:panel>
	</h:form>
</h:body>
</html>
